// Copyright (c) MatrixFramework. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System.Collections.Generic;
using Matrix.ServiceCommunication.Services;

namespace Matrix.ServiceCommunication.Discovery.LoadBalancing;

/// <summary>
/// 负载均衡器接口
/// </summary>
public interface ILoadBalancer
{
    /// <summary>
    /// 负载均衡策略名称
    /// </summary>
    string StrategyName { get; }

    /// <summary>
    /// 从实例列表中选择一个实例
    /// </summary>
    /// <param name="instances">可用实例列表</param>
    /// <returns>选中的实例</returns>
    ServiceInstance Select(IList<ServiceInstance> instances);
}